#include "core/cell-dyn-mt.hpp"

namespace FastMD
{
	////////////////////////////////////////////////////////////////////////////
	//
	//
	//
	//
	////////////////////////////////////////////////////////////////////////////
	CellDynamicsMT:: CellDynamicsMT( const Frame &frame, const Real CutOut ) :
	Team(),
	CellDynamicsBase(frame,CutOut,size),
	frame_(NULL),
	potential_(NULL),
	task_( this, & CellDynamicsMT:: call )
	{
	}
	
	CellDynamicsMT:: ~CellDynamicsMT() throw()
	{
		
	}
	
	void CellDynamicsMT:: eval( Frame &frame , Potential &potential, bool isothermal) throw()
	{
		frame_     = &frame;
		potential_ = &potential;
		
		prolog(frame);
		cycle(task_);
		epilog(frame,isothermal);
	}
	
	void CellDynamicsMT:: call( Team::context &ctx ) throw()
	{
		work( ctx.rank, *frame_, *potential_ );
	}
	
	
}

